import { Actions, Mutations } from '@/enum/dict'

type IActionsType<T extends Record<string, string> = typeof Actions> = {
  [K in keyof T]: T[K]
}

type IMutationsType<T extends Record<string, string> = typeof Mutations> = {
  [K in keyof T]: T[K]
}

export const ActionsType = Object.entries(Actions).reduce<IActionsType>(
  (acc, [key, value]) => {
    acc[key] = 'dictionary/' + value
    return acc
  },
  {
    ...Actions,
  }
)

export const MutationsType = Object.entries(Mutations).reduce<IMutationsType>(
  (acc, [key, value]) => {
    acc[key] = 'dictionary/' + value
    return acc
  },
  {
    ...Mutations,
  }
)
